
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MQTT_ALARM_H
#define __MQTT_ALARM_H

#ifdef __cplusplus
extern "C" {
#endif

#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "mqtt.h"

/* Exported macros-------------------------------------------------------------*/

typedef     union 
{
    u8 byte_8;
    struct
    {
      u8 bit0:1;u8 bit1:1;u8 bit2:1;u8 bit3:1;
      u8 bit4:1;u8 bit5:1;u8 bit6:1;u8 bit7:1;             
    }bit;
    
}AlarmUnion_TypeDef;


/* Exported functions prototypes ---------------------------------------------*/

/* Private defines -----------------------------------------------------------*/
void alarm_status_net_channel(uint8_t type,uint8_t data,uint8_t state ,uint8_t net_channel);
void alarm_status_interface(uint8_t type,uint8_t data,uint8_t state );
void alarm_DIY_status_interface(uint16_t type,uint16_t pinid,uint8_t data,uint8_t state,char * name);
void alarm_recover_all( void );

void Network_4G_detection_alarm( uint8_t status );
void Network_TCP_detection_alarm( uint8_t status );
void Door_open_alarm_event(uint8_t state);
void Vibration_alarm_event(uint8_t state);
void Smoke_alarm_event(uint8_t state);
void Waterlogging_alarm_event(uint8_t state);
void shock_alarm_event(uint8_t state);
void infrared_alarm_event(uint8_t state);

void Vibration_EXTI_Handler(void);


void alarm_execute_event(void);

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */

